// 使用 module.exports 代替 export
function createDebounce() {
  let timers = {};
  return function(id, fn, delay = 500) {
    if (timers[id]) clearTimeout(timers[id]);
    timers[id] = setTimeout(() => {
      fn();
      delete timers[id];
    }, delay);
  };
}

// 导出方式改为 CommonJS
module.exports = {
  createDebounce
};
